<template>
  <div class="decision" :class="fullScreen?'decision-wrapper':''" >
    <div class="nav-top"  :class="leftAnimate"  :style="{width:navWidth+ 'px',top:top+'px'}">
      <div class="nav-top-container">
        <h2 class="nav-top-title">高校毕业生就业情况分析</h2>
        <div class="top-operate">
          <svg class="all-close-btn icon-svg" v-if="!fullScreen" @click="closeAll"  viewBox="0 0 612 792">
            <path :d="svgPath.closeFullScreen"/>
          </svg>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import {svgPath,quitFullScreen} from "../../assets/js/utils";
  import {loadingOpt} from '../../assets/js/utils.js'
  export default {
    props: ['isChange','isCollapse','pageChange','fullScreen'],
    data() {
      return{
        leftAnimate:'',
        svgPath:svgPath,
        navWidth:800,
        top:70,
        height: 500,
      }
    },
    watch:{
      isChange(){
        setTimeout(()=>{
          this.getChartItem();
        },100)
      },
      pageChange(){},
    },
    mounted() {
      this.getChartItem();
    },
    methods: {
      closeAll(){
        quitFullScreen();
      },
      //动态设置宽高
      getChartItem(){
        let height = document.querySelector('body').clientHeight;
        let barHeight = 70;
        let sideWidth = 44;
        let bodyWidth = document.querySelector('body').clientWidth;
        let top = 70;
        if (document.querySelector('.el-header')) {
          barHeight = document.querySelector('.el-header').clientHeight;
          if(document.querySelector('.el-aside')){
            sideWidth = document.querySelector('.el-aside').clientWidth;
          }
        } else {
          barHeight = 0;
          sideWidth = 0;
          top=0;
        }
        this.top = top;
        this.left = sideWidth;
        this.navWidth = bodyWidth - sideWidth;
        this.height = height - barHeight -54 ;
        if(this.myChartPie){
          setTimeout(()=>{
            this.resize();
          },100)
        }
        //每一个图表块的宽度
        let width = 1000;
        if(document.querySelector('.chart-box')){
          width = document.querySelector('.chart-box').clientWidth;
        }
        this.width = (width - 44) / 2;
        //nav-top left值
      },
    },
  }
</script>
<style scoped>
  @import '../../assets/css/decision.css';
</style>
